package org.sundatagroup.aurora.monitor.entity.command;

import com.google.gson.JsonObject;

/**
 * <p>跳转播放工程的播放器类型的指令
 * </p>
 * 
 * @author Zdream
 * @date 2018-05-29
 * @since 0.2.0
 */
public class SwitchProjectCommand extends PlayerCommand {
	
	/**
	 * 跳转到的工程
	 */
	public final int pid;
	
	SwitchProjectCommand(int pid) {
		this.pid = pid;
	}

	@Override
	public String name() {
		return "switch-to-player";
	}
	
	@Override
	public JsonObject toJson() {
		JsonObject root = super.toJson();
		
		JsonObject value = new JsonObject();
		value.addProperty("pid", pid);
		root.add("value", value);
		
		return root;
	}

}
